#!/usr/bin/perl

use warnings;
use strict;

my $time = localtime();
print "REGISTRATION INFORMATION FOR SPRING QUARTER\n";
print "Today's date is $time\n";
print "Please enter the following information:\n";
print "Your full name: ";
chomp(my $name = <STDIN>);
print "What is your Social Security Number (xxx-xx-xxxx): ";
chomp(my $sec_num = <STDIN>);
print "Your address:\n";
chomp(my $address = <STDIN>);

my %elective = (
    '2CPR2B' => 'C Language',
    '1UNX1B' => 'Intro to UNIX',
    '3SH414' => 'Shell Programming',
    '4PL400' => 'Perl Programming',
);

foreach my $key ( sort { $elective{$a} cmp $elective{$b} }
    keys %elective) {
    print "_____________________________\n";
    printf("%s\t| %s\n", $key, $elective{$key});
}
print "_____________________________\n";

print "What is the EDP number of the course you wish to take? ";
chomp(my $edp_num = <STDIN>);
printf "The course you wil be taking is \"%s\".\n", $elective{uc $edp_num};

print "Registration confirmation will be sent to your address at\n";
print $address, "\n";

printf "Thank you, %s, for enrolling.\n", split(" ", $name);
